SWEN-340

Big to Little Endian Converters

Overview

This homework assignment is to write untlity functions to convert integers from big to little endian.

Setup

While it would be nice if the MIDI format was all little-endian, it unfortunately is big-endian. We could write a formatting program to change it, but this would be very complex and not worth the effort. Instead, we'll want to write a couple utility functions that can convert big-endian 16-bit and 32-bit values to little-endian. I'm suggesting the following prototypes, but you can make changes, as long as they are well documented in your code. For the project, you may also find it helpful to write a conversion function for 24-bit values but it is not required.

    uint16_t convert_to_uint16 (uint8_t* p_value);
    uint32_t convert_to_uint32 (uint8_t* p_value);

Using these functions, rewrite the code from activity-9 to properly display the song information. You should place all three functions in their own appropriately named file (with a proper header file). You can reuse the structs file and function from the activity as well.

Submission

Submit your solution by pushing any code written to the course repo by the deadline.

Grading

To receive full credit, Code must compile and run as expected without any warnings!